package com.it.sun.learning001.lifecycle;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import org.springframework.beans.factory.DisposableBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @ClassName com.it.sun.learning001.lifecycle.DisposableBeanImpl
 * @Author sunmannian
 * @Date 2021/6/15 16:09
 * @Version V1.0
 * Description  <请输入一句话描述该类功能>
 * Copyright (C) 北京中电兴发科技有限公司  since 2021/6/15
 */
public class DisposableBeanImpl implements DisposableBean {

	private static Log logger = LogFactory.get(DisposableBeanImpl.class);

	@Override
	public void destroy() throws Exception {
		logger.info("DisposableBean=====> 接口销毁");
	}


	@PreDestroy()
	public void close() {
		logger.info("PreDestroy=====> 注解销毁");
	}

	@PostConstruct()
	public void init() {
		logger.info("PostConstruct=====> 注解初始化");
	}


	public void destroyMethod() {
		logger.info("destroyMethod=====> 方法销毁");
	}
}



